<#include "../common/layout.ftl"/>
<@layout>
<div class="well" style="height:30px">
	<form method="post" action="/categoryorder/caroverhaulList" class="form-inline">
		<span class="label label-success">车辆检修订单</span>
		<input type="text" class="input-medium" style="height: 26" placeholder="订单号" name="id"/>
		<button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i>查询</button>
		<button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
	</form>
</div>
<div class="well">

	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th>单号</th>
			<th>订单来源</th>
			<th>订单种类</th>
			<th>订单状态</th>
			<th>取车联系人</th>
			<th>取车电话</th>
			<th>取车地点</th>
			<th>取车时间</th>
			<th>还车目的地</th>
			<th>还车联系人</th>
			<th>还车电话</th>
			<th>下单时间</th>
			<th>发布时间</th>
			<th>备注</th>
			<th>操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list page.list as order>
		  <tr>
		    <td>${order.id}</td>
		    <td>
			  <#list session.telLists as tel>
			  	 <#if order.source==tel.company>
			  	 	${tel.companyname}
			  	 </#if>
			  </#list>
		    </td>
			<td>
			   <#if order.order_category_type ??>
					<#list session.orderTypeMapList as orderType>
		    			<#if orderType.value == order.order_category_type>
		    			  ${orderType.name}
		    			</#if>
		    		</#list>
	    	    </#if>
			</td>
			<td>
			 <#list session.orderStatusTypeArray as orderStatusType>
			 	<#if orderStatusType.orderStatus == order.order_state>
			 		${orderStatusType.orderName}
			 	</#if>
			 </#list>
			</td>
			<#if order.member_id == 0>
				<td>
				  ${order.real_name!""}
				</td>
				<td>
				  ${order.cell_phone!""}
				</td>
		  	<#else>
				<td>
				  ${order.real_name2!""}
				</td>
				<td>
				  ${order.cell_phone2!""}
				</td>
		  	</#if>
			<td>
			 ${order.startpoint!" "}
			</td>
			<td>
			 ${order.point_time!" "}
			</td>
			<td>
			 ${order.endpoint!" "}
			</td>
			<td>
			 ${order.receive_name!" "}
			</td>
			<td>
			 ${order.receive_phone!" "}
			</td>
			<td>
			<#if order.create_time??> 
			 ${order.create_time?string("yyyy年MM月dd日HH时mm分ss秒") }  
			</#if>
			</td>
			<td>
			 <#if order.publish_time??> 
			 ${order.publish_time?string("yyyy年MM月dd日HH时mm分ss秒") }  
			</#if>
			</td>
			</td>
			<td>
			 ${order.remark!" "}
			</td>
			<td nowrap>
			     <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="btn btn-success" href="/order/assignmentDriver/${order.id}" target="_blank" >派单</a>
				 </#if>
				 <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="btn btn-success" href="/order/addressupdate/${order.id}"><i class="icon-leaf icon-white"></i> 修改出发地目的地</a>
				 </#if>
				 <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="btn btn-success" href="/order/cancelNotAccept/${order.id}"  >取消</a>
				 </#if>
				 <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="btn btn-success" href="/order/assignment/${order.id}" >重发</a>
				 </#if>
				  <#if (order.timeDiffe?exists)>
				  <#if (order.timeDiffe>=3)>
			      <embed id = "soundControl1"  src="/sound.mp3"  mastersound hidden = "true"  loop ="false"  autostart = "true"></embed>
			      </#if>
			      </#if>
			</td>
			
			
		  </tr>
		</#list>
		</tbody>
	</table>
	<#include "../common/paginate.ftl" />
	<@paginate currentPage=page.pageNumber totalPage=page.totalPage actionUrl="/categoryorder/caroverhaulList/" />
</div>

</@layout>